package com.aabte.permissionframeworklearn.permission.mapper;

import com.aabte.permissionframeworklearn.permission.model.SysDept;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysDeptMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysDept record);

    int insertSelective(SysDept record);

    SysDept selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysDept record);

    int updateByPrimaryKey(SysDept record);

    List<SysDept> getAllDept();

    List<SysDept> getChildDeptListByLevel(@Param("level") String level);

    void batchUpdateLevel(@Param("sysDepts") List<SysDept> sysDepts);

    long countByNameAndParentId(@Param("parentId") Long parentId,
                                @Param("deptName") String deptName,
                                @Param("deptId") Long deptId);

    int countByParentId(@Param("parentId") Long parentId);
}